package com.augurit.common.calendar.convert;

import java.util.ArrayList;
import java.util.List;

import com.augurit.common.calendar.model.ExtCalendarType;
import com.augurit.common.syscode.web.form.SysCodeForm;

public class CalendarTypeConvertor {
	/**
	 * 转换为日程类型下列框列表
	 * @param calendarTypes
	 * @return
	 */
	public static List<ExtCalendarType> convertToCombos(List<SysCodeForm> calendarTypes){

		List<ExtCalendarType> result = null;
		
		if(calendarTypes != null && calendarTypes.size() > 0){
			result = new ArrayList<ExtCalendarType>();
			for(SysCodeForm form : calendarTypes){
				ExtCalendarType extCalendarType = new ExtCalendarType();
				extCalendarType.setTitle(form.getItemName());
				extCalendarType.setId(form.getItemCode());
				result.add(extCalendarType);
			}
		}
		
		return result;
	}
}
